// src/api/book.js
import request from '@/utils/request'

export default {
  // findBooks() {
  //   return request({
  //     url: '/books/list',
  //     method: 'get'
  //   })
  // },

  saveBook(url, method, book) {
    return request({
      url: url,
      method: method,
      data: book
    })
  },

  findByPage(page, pageSize) {
    return request({
      url: `/books/page/${page}/${pageSize}`,
      method: 'get'
    })
  },

  searchBooks(page, pageSize, bookSearch) {
    return request({
      url: `/books/search/${page}/${pageSize}`,
      method: 'post',
      data: bookSearch
    })
  },

  deleteBook(bid) {
    return request({
      url: `/books/delete/${bid}`,
      method: 'put'
    })
  }
}